package com.cjack.frenchexcel.controller;

import com.cjack.frenchexcel.config.AjaxResult;
import com.cjack.frenchexcel.config.CommonConfig;
import com.cjack.frenchexcel.service.DataSummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * 数据统计相关
 * Created by root on 10/5/19.
 */
@RestController
@RequestMapping(value = "/suammary")
public class DataSummaryEndpoint {

    @Autowired
    private DataSummaryService service;
    /**
     * 员工信息汇总统计
     * @return
     */
    @RequestMapping(value = "/employee", method = RequestMethod.GET)
    @ResponseBody
    public AjaxResult employee( HttpSession session) {
        Object loginUserId = session.getAttribute( CommonConfig.SESSION_NAME);
        return AjaxResult.SUCCESS( service.employee( (Long) loginUserId));
    }
}
